/*
 * halton.h
 *
 *  Created on: Nov 11, 2009
 *      Author: karthik
 */

#ifndef HALTON_H_
#define HALTON_H_

#include <vector>

// Prime numbers used for generating halton quasi random sequences.
static int primes [ ] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 43, 47, 53, 59};
//static int primes [ ] = { 17, 19, 23, 29, 31, 37, 43, 47, 53, 59};

// This limits us to 16 dimensions.

class Halton{
    public:
		Halton(int dim);		//	Constructor for a Halton object.
		std::vector<double> getNext();	//	Get next random vector. (generates uniformly distributed random numbers in (0,1) )
		std::vector<double> getNextGaussian();	// Get next Gaussian Sequence (by taking inverse std normal of uniform random vector).

    private:
	   const int dim_;		//	dimension
	   int ind;				//	index (the xth random number sequence). It is incremented after each getNext() or getNextGaussian().
};


#endif /* HALTON_H_ */
